<template>
	<view>
		<!-- 搜索 -->
		<view class="">
			<view class="flex align-center" style="height: 90rpx;">
				<input type="text" v-model="keyword" 
				  class="flex-1 rounded ml-3 px-2" 
				  style="height: 56rpx;background-color: #ececec;" 
				  placeholder="请输入设备号"
				  confirm-type="search"
				  @confirm="confirm"
				/>
				<!-- 右边 -->
				<view style="width: 85rpx;" class="flex align-center justify-center" @click="navBack">
					<text class="font" style="color: #858585;">返回</text>
				</view>
			</view>
		</view>
		<!-- end 搜索 -->
		
		<!-- 查询列表 -->
		<scroll-view scroll-y :style="{'height': scrollH+'px'}" class="mt-2">
			<view class="mt-2">
				
			</view>
		</scroll-view>
		<!-- end 列表 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollH: 60,
				keyword: '',
				timeIndex: 0,
				list: [],
				query: {
					pageNum: 1,
					pageSize: 10,
					imei: ''
				},
			}
		},
		onReady() {
			let res = uni.getSystemInfoSync()
			this.scrollH = res.windowHeight - uni.upx2px(90)
			// #ifdef MP
			this.scrollH -= 44
			// #endif
		},
		methods: {
			navBack() {
				this.keyword = ''
				uni.navigateBack({
					delta: 1
				})
			},
			confirm(event) {
				console.log(event)
				uni.showToast({
					title: event.detail.value,
					icon: 'none'
				})
			},
			search() {
				this.$H.get('/water/device_info/list', this.query, { token: true }).then(res => {
					console.log(res)
					this.list = res.rows;
				})
			},
		}, // end methods
	}
</script>

<style>

</style>
